package cn.cxq.learning.web;

import cn.cxq.learning.model.User;
import cn.cxq.learning.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @Autowired
    private UserService userService2;

    @RequestMapping("/userDetail")
    public String doQueryUserDetail(Model model, Integer id, String username){

        User user = userService.queryUser(id, username);
        User user2 = userService2.queryUser(id, username);

        model.addAttribute("user",user);
        model.addAttribute("user2",user2);

        return "userDetail";
    }
}
